//
//  newsTableViewCell.m
//  网易新闻
//
//  Created by mac on 16/7/21.
//  Copyright © 2016年 xbk. All rights reserved.
//

#import "newsTableViewCell.h"
#import <UIImageView+WebCache.h>

@interface newsTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *myImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *sourceLabel;
@property (weak, nonatomic) IBOutlet UILabel *replayLabel;
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *imageViews;



@end

@implementation newsTableViewCell

- (void)setModel:(newsModel *)model{

    _model = model;
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:model.imgsrc]];
    
    self.titleLabel.text = model.title;
    self.sourceLabel.text = model.source;
    self.replayLabel.text = [NSString stringWithFormat:@"%@",model.replyCount];
    
    for (int i=0; i<model.imgextra.count; ++i) {
        
        UIImageView *img = self.imageViews[i];
        
        NSDictionary *dic = model.imgextra[i];
        
        NSString *imgsrc = [dic objectForKey:@"imgsrc"];
        
        [img sd_setImageWithURL:[NSURL URLWithString:imgsrc]];
    }
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
